$(function(){
	$("#load_more").hover(function(){
			$(this).css("background-color","#C8E4F2");
		},function(){
			$(this).css("background-color","#E3EEF8");
	});
	
	/*Ajax请求发送前执行，改变#load_more的CSS与内容*/
	$("#load_more").ajaxStart(function(){
		$(this).css("background-color","#4DC36F");
		$(this).find("#load_words").text("正在加载中...");
	});
	/*Ajax请求结束后执行，改变#load_more的CSS与内容*/
	$("#load_more").ajaxStop(function(){
		$(this).css("background-color","#C8E4F2");
		$(this).find("#load_words").text("加载更多微博");
	});
	/*点击#load_more，执行Ajax请求*/
	$("#load_more").live('click',function(){
		var num = $(this).find("#load_num").text();
		$.ajax({
			type: "POST",
			url: "php_ajax/loadmore.php",
			dataType: "html",
			cache: false,
			data: {weibo_num: num},
			success: function(data){
				if(data){
					$("#weibo_box").append(data);
					num = (Number(num) + 20);
					var new_num = num.toString();
					$("#load_num").text(new_num);
				}
			}
		});		
	});
});